package com.changyue.activity.home;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.Window;
import android.view.WindowManager;


import com.changyue.blood.R;
import com.changyue.blood.databinding.DialogInputCdhBinding;


public class InputCDHView {

    DialogInputCdhBinding binding;

    public InputCDHDialog inputCDHDialog;

    Context context;

    InputCDHDialogInterface cdhDialogInterface;

    public InputCDHView(Context context) {
        this.context = context;

        inputCDHDialog = new InputCDHDialog(context, R.style.sku_dialog);

        binding = DialogInputCdhBinding.inflate(LayoutInflater.from(context));
        inputCDHDialog.setContentView(binding.getRoot());

        Window dialogWindow = inputCDHDialog.getWindow();
        dialogWindow.getDecorView().setPadding(0,0,0,0);
        dialogWindow.setBackgroundDrawableResource(android.R.color.transparent);

        WindowManager.LayoutParams lp = dialogWindow.getAttributes();
        lp.width = WindowManager.LayoutParams.MATCH_PARENT;
        lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
        dialogWindow.setAttributes(lp);

        dialogWindow.setGravity(Gravity.CENTER);



    }

    public InputCDHDialogInterface getCdhDialogInterface() {
        return cdhDialogInterface;
    }

    public void setCdhDialogInterface(InputCDHDialogInterface cdhDialogInterface) {
        this.cdhDialogInterface = cdhDialogInterface;
    }


    public void show() {
        inputCDHDialog.show();
    }

    public void dismiss() {
        inputCDHDialog.dismiss();
    }

}
